home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Reference Guide
/
C-C++ Interactive Reference Guide.iso
/
c_ref
/
csource3
/
144_01
/
example.hlp
< prev
next >
Wrap
Text File
|
1985-08-21
|
4KB
|
199 lines
EXAMPLES
LIST FILES IN A NICE FORMAT ON THE SCREEN
Build a submit file with the following command. It will put out
a very nice 5 column list of filenames sorted verticaly. No
arguments will give a list of all files. A wild card argument
will give a limited display like DIR. a second argument will
allow the output to be sent to a file or the printer.
LS $1 |2UP -L22N5W $2
PRINT A TEXT FILE WITH A LEFT MARGIN FOR 3-HOLE PUNCHING
PAGE <file -M10 >lst:
BUILDING SUBMIT FILES
The following sequence will create a file CLEAN.SUB which is
a submit job to clean control characters out of all files of
type xxx.
LS *.xxx |SUB * CLEAN_<*_>* >CLEAN.SUB
A BACKUP SUBMIT FILE BUILDER
The following sequence will create a file BACKUP.SUB which
is a submit job to backup all files of type xxx from disk A: to
disk B:.
LS *.xxx |SUB * COPY_B:*_=A:* >BACKUP.SUB
Either of the above sequences were themselves placed in a .SUB
file. Thus, if the file BLDBKUP.SUB contained:
LS *.$1 |SUB * COPY_B:*_=A:* >BACKUP.SUB
Then the command:
SUBMIT BLDBKUP BAS
would create the file BACKUP.SUB to backup all .BAS files and
the command
SUBMIT BACKUP
would execute that function.
CREATING AN INDEX FROM A DOCUMENT FILE
The following commands in a submit file would allow an index to
be built for any text file by use of a single submit
command.
WORDS <$1 -NL66 |SORT -C9U |MERGE -C9UI NOISE.WRD >$TEMP$
INDEX -C29 <$TEMP$ |2UP -M10L60C29S2 |PAGE >INDEX.DOC
ERA $TEMP$
Which would be called by:
SUBMIT INDEX filename
This would create an index based on 66 line pages of the
named file. The index would be formatted in 2 columns spaced
out on a 66 line page format. The index would contain all
words in the text except those contained in the NOISE.WRD file
which contains "noise words" such as "the", "and", etc.
Create the NOISE.WRD file from a text file containing just
noise words by:
WORDS <NOISE.TXT -N |SORT -C9U >NOISE.WRD
The same submit file can be modified by changing the "L66"
after WORDS to "L1" and would give a cross reference
instead.
ANOTHER TYPE OF BACKUP STRATEGY
If you use an editor which creates .BAK files types for any
file modified, you can use this as a signal to select out
files for backing up. The following submit file can be used.
LS *.BAK |SUB { COPY_B:=A: |SUB .BAK .* >BKUP.SUB
ERA *.BAK
This creates a file BKUP.SUB to backup to disk B: all files
named the same as the .BAK file.
BRACE CHECKING IN C PROGRAMS
A common problem in C programs is having unmatched { } pairs.
These are difficult to locate and a simple search for one
character in an editor or with SELECT will not do the job.
The following submit commands will find and display lines
containing either bracket along with the line number for that
line.
SUB <$1.C \} \{\}\{ |SELECT \{ -N |SUB \{\}\{ \} $2
The $2 argument allows the default output to be to the
screen, but the output can be redirected to the printer
(>LST:) or a file.